#region

using DomainModel.Domain.Model.MessageAssemblyModel;
using FluentNHibernate.Mapping;

#endregion

namespace DomainModel.Infrastructure.Mappings
{
    public class MessageAssemblyMap : ClassMap<MessageAssembly>
    {
        public MessageAssemblyMap()
        {
            CompositeId(x => x.Id).KeyProperty(x => x.Id);

            Map(x => x.FileSize);
            Map(x => x.FileName);
            Map(x => x.Name);
            Map(x => x.LocalName);
            Map(x => x.Hash);

            HasManyToMany(x => x.MessageTypesList)
                //.AsBag()
                .Table("MessageTypeMessageAssembly");
        }
    }
}